//
//  ApiCenter.swift
//  Inquiry
//
//  Created by SSD on 2019/9/10.
//  Copyright © 2019 SSD. All rights reserved.
//

import Foundation
class ApiCenter: SWNetworkApi {}

extension ApiCenter {
    convenience init(method: SWNetwork.HttpMethod, url: String, parameters: [String:Any]?, responseSuccess: ResponseSuccess? = nil, functionName: String = #function) {
        self.init()
        self.method = method
        self.url = url
        self.parameters = parameters
        self.functionName = functionName
        
        if let responseSuccess = responseSuccess {
            self.responseSuccess = responseSuccess
        } else {
            self.responseSuccess = { anyObject, response -> SWNetworkResponse in
                return NetworkCenter.responseSuccess(anyObject, response)
            }
        }
    }
}
